﻿using Manox.Libs.ODB;
using System;
using UnityEngine;

namespace Manox.Libs.MVC
{
    /// <summary>
    /// Model.
    /// </summary>
    [Serializable]
    public class Model : ObjectDatabaseObject
    {
        /// <summary>Graphics resource name.</summary>
        public ObjectDatabaseProperty<string> ViewResourceName;


        /// <summary>
        /// Init.
        /// </summary>
        public override void Init()
        {
            base.Init();
        
            this.ViewResourceName = new ObjectDatabaseProperty<string>();            
        }        
    }


    /// <summary>
    /// Position rotation model.
    /// </summary>
    [Serializable]
    public class PositionRotationModel : Model
    {
        /// <summary>Position.</summary>
        public ObjectDatabaseProperty<Vector3> Position;
        /// <summary>Rotation.</summary>
        public ObjectDatabaseProperty<Quaternion> Rotation;


        /// <summary>
        /// Init.
        /// </summary>
        public override void Init()
        {
            base.Init();
        
            this.Position = new ObjectDatabaseProperty<Vector3>();
            this.Rotation = new ObjectDatabaseProperty<Quaternion>();
        }
    }

    /// <summary>
    /// Predicted position rotation model.
    /// </summary>
    [Serializable]
    public class PredictedPositionRotationModel : PositionRotationModel
    {
        /// <summary>Time.</summary>
        public ObjectDatabaseProperty<float> Time;


        /// <summary>
        /// Init.
        /// </summary>
        public override void Init()
        {
            base.Init();

            this.Time = new ObjectDatabaseProperty<float>();            
        }
    }
}
